]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
networkAgent: Do not remove child watch source
authorMichael Catanzaro <mcatanzaro@redhat.com>
Mon, 20 Oct 2025 21:26:34 +0000 (16:26 -0500)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 24 Nov 2025 13:42:59 +0000 (14:42 +0100)
The child watch source is the only thing that reaps the child process.
We cannot remove it until it fires or the child will remain a zombie.
So, just leave the source attached. Trying to remove it does not seem
easy, and I don't see any need; we expect the child process to exit
quickly, so this doesn't seem harmful.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7083
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3926>
(cherry picked from commit 961a7d721f3e4db9be6df958b10ba98955138cae)

js/ui/components/networkAgent.js

index f3e7cdc8050c0b5fff280d9fde1387e1d63fc5a1..3fad7cb8165f78d24e40545f38a16ea5d8099901 100644 (file)
@@ -473,7 +473,7 @@ class VPNRequestHandler extends Signals.EventEmitter {
             else
                 this._readStdoutOldStyle();
 
-            this._childWatch = GLib.child_watch_add(GLib.PRIORITY_DEFAULT, pid,
+            GLib.child_watch_add(GLib.PRIORITY_DEFAULT, pid,
                 this._vpnChildFinished.bind(this));
 
             this._writeConnection();
@@ -505,8 +505,6 @@ class VPNRequestHandler extends Signals.EventEmitter {
             return;
 
         this.emit('destroy');
-        if (this._childWatch)
-            GLib.source_remove(this._childWatch);
 
         this._stdin.close(null);
         // Stdout is closed when we finish reading from it
@@ -515,7 +513,8 @@ class VPNRequestHandler extends Signals.EventEmitter {
     }
 
     _vpnChildFinished(pid, status, _requestObj) {
-        this._childWatch = 0;
+        if (this._destroyed)
+            return;
         if (this._newStylePlugin) {
             // For new style plugin, all work is done in the async reading functions
             // Just reap the process here